﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.IO;
//using Pibby.Core.IntegrationTests.Stubs;
//using invrt;
//using Pibby.Core.Models;
//using Pibby.Core.Persistence;
//using Pibby.Core.Presenters;
//using Pibby.Core.Views;
//using Pibby.Core.Web;


//namespace Pibby.Core.Tests
//{
//    /// <summary>
//    /// Used as the base for most test fixtures - creates mocks and stub objects
//    /// </summary>
//    public abstract class IntegrationBaseTestFixture
//    {
//        private PodcastRepository _repository;

//        [TestInitialize]
//        public virtual void Setup()
//        {
//            this.CreateIocObjects();
//        }

//        private void CreateIocObjects ()
//        {
//            InversionOfController.Factory = new TypeFactory(new SimpleTypeResolver());

//            InversionOfController.Factory.RegisterType<IDownloadingService, Stubs.DownloadingService>();
//            InversionOfController.Factory.RegisterType<ICopyFiles, Stubs.FileCopier>();

//            InversionOfController.Factory.RegisterType<IDriveFactory, DriveFactory>();
//            InversionOfController.Factory.RegisterType<IFolderFactory, FolderFactory>();

//            InversionOfController.Factory.RegisterType<IReadText, Stubs.FakeTextReader>();
//            InversionOfController.Factory.RegisterType<IWriteText, Stubs.FakeTextWriter>();

//            InversionOfController.Factory.RegisterType<IEjectDevices, Stubs.DriveEjector>();
//            InversionOfController.Factory.RegisterType<IRecycleFiles, Stubs.FileRecycler>();
//        }

//        [TestCleanup]
//        public virtual void TearDown()
//        {
//            if (this._repository != null)
//            {
//                this._repository.Dispose();
//                this._repository = null;
//            }
//        }

//        protected IPodcastRepository Repository
//        {
//            get 
//            {
//                if (this._repository == null)
//                {
//                    this._repository = new PodcastRepository(":memory:");
//                    this._repository.CreateNewDatabase();
//                }

//                return this._repository; 
//            }
//        }
//    }
//}
